<?php
ob_start();
?>

<div id="content">
    <h3 style="padding-bottom:20px">Preencha o formulário completo:</h3>
    <form action="../controller/cadastraMedicamento.php" method="post">
        <table align="center" cellpadding="2" cellspacing="2">
            <tr>
                <td align="left">Nome </td>
                <td>
                    <input type="text" name="nome" required id="nomeID">
                </td>
            </tr>
            <tr>
                <td align="left">Marca</td>
                <td>
                    <input type="text" name="marca" required id="marcaID">
                </td>
            </tr>
            <tr>
                <td align="left">Composição</td>
                <td>
                    <input type="text" name="composicao" required id="composicaoID">
                </td>
            </tr>
            <tr>
                <td align="left">Med. Relacionado</td>
                <td>
                    <?php
                    include ("../model/medicamento.php");
                    $medicamento = Medicamento::FindAll();

                    echo "<select name='medRelacionado' id='medRelID'>";
                    echo "<option value='NULL' selected></option>";
                    while ($row = mysql_fetch_assoc($medicamento)) {
                        echo "<option value=" . $row['id'] . ">" . $row['nome'] . "</option>";
                    }
                    echo "</select>";
                    ?>

                </td>
            </tr>
            <tr><td colspan="2" align="center">
                    <input type="submit" value="Enviar">
                    <input type="reset" value="Limpar">
                </td></tr>        
        </table>
    </form>
</div>

<?php
$pagemaincontent = ob_get_contents();
ob_end_clean();
$GLOBALS['superUser'] = 1;
$pagetitle = "Cadastrar Funcionário";
include("master.php");
?>